package cn.bdqn.test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import cn.bdqn.bean.User;
import cn.bdqn.service.UserService;
import cn.bdqn.service.impl.UserServiceImpl;

public class testUser {

	public static void main(String[] args) {
		UserService service = new UserServiceImpl();
		boolean flag = false;
		User user = new User();
		/*user.setUserCode("lsn");
		user.setPassword("admin");
		user.setUserName("李淑娜");
		user.setAddress("河南濮阳");
		user.setGender(0);
		user.setPhone("13693386640");
		user.setUserType(0);
		user.setBirthdate("1980-10-25");
		user.setCreateDate(new Date());
		boolean flag = service.addUser(user);*/
		/*user.setId(7);
		user.setUserCode("123");
		flag = service.updateUser(user);*/
		Date now = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		try {
			Date birth = sdf.parse("1987-10-03");
			System.out.println(birth.getTime()+"\t" + birth.getYear()+1900);
			System.out.println(now.getTime() +"\t" + now.getYear() + 1900);
			System.out.println((now.getTime()- birth.getTime())/(1000*60*60*24*365)+"\t" + (now.getYear()-birth.getYear()));
			
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		

	}

}
